<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Authentication</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: Authentication</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>Authentication<span class="signature">(options)</span><span class="type-signature"></span></h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    
    <h4 class="name" id="Authentication"><span class="type-signature"></span>new Authentication<span class="signature">(options)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Creates a new Auth0 Authentication API client</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>domain</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>your Auth0 domain</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>clientID</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>the Client ID found on your Application settings page</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>redirectUri</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>url that the Auth0 will redirect after Auth with the Authorization Response</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>responseType</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>type of the response used by OAuth 2.0 flow. It can be any space separated list of the values <code>code</code>, <code>token</code>, <code>id_token</code>. <a href="https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html">https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>responseMode</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>how the Auth response is encoded and redirected back to the client. Supported values are <code>query</code>, <code>fragment</code> and <code>form_post</code>. <a href="https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes">https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scope</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>scopes to be requested during Auth. e.g. <code>openid email</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audience</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>identifier of the resource server who will consume the access token issued after Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cookieDomain</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>The domain the cookie is accessible from. If not set, the cookie is scoped to the current domain, including the subdomain. To keep a user logged in across multiple subdomains set this to your top-level domain and prefixed with a <code>.</code> (eg: <code>.example.com</code>).</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line30">line 30</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://auth0.com/docs/api/authentication">https://auth0.com/docs/api/authentication</a></li>
        </ul>
    </dd>
    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="buildAuthorizeUrl"><span class="type-signature"></span>buildAuthorizeUrl<span class="signature">(options)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Builds and returns the <code>/authorize</code> url in order to initialize a new authN/authZ transaction</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>clientID</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>the Client ID found on your Application settings page</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>redirectUri</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>url that the Auth0 will redirect after Auth with the Authorization Response</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>responseType</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>type of the response used by OAuth 2.0 flow. It can be any space separated list of the values <code>code</code>, <code>token</code>, <code>id_token</code>. <a href="https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html">https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>responseMode</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>how the Auth response is encoded and redirected back to the client. Supported values are <code>query</code>, <code>fragment</code> and <code>form_post</code>. <a href="https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes">https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>state</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>value used to mitigate XSRF attacks. <a href="https://auth0.com/docs/protocols/oauth2/oauth-state">https://auth0.com/docs/protocols/oauth2/oauth-state</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nonce</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>value used to mitigate replay attacks when using Implicit Grant. <a href="https://auth0.com/docs/api-auth/tutorials/nonce">https://auth0.com/docs/api-auth/tutorials/nonce</a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scope</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>scopes to be requested during Auth. e.g. <code>openid email</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audience</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>identifier of the resource server who will consume the access token issued after Auth</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line113">line 113</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://auth0.com/docs/api/authentication#authorize-client">https://auth0.com/docs/api/authentication#authorize-client</a></li>
        
            <li><a href="https://auth0.com/docs/api/authentication#social">https://auth0.com/docs/api/authentication#social</a></li>
        </ul>
    </dd>
    

    
</dl>




















        
            

    

    
    <h4 class="name" id="buildLogoutUrl"><span class="type-signature"></span>buildLogoutUrl<span class="signature">(options)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Builds and returns the Logout url in order to initialize a new authN/authZ transaction</p>
<p>If you want to navigate the user to a specific URL after the logout, set that URL at the returnTo parameter. The URL should be included in any the appropriate Allowed Logout URLs list:</p>
<ul>
<li>If the client_id parameter is included, the returnTo URL must be listed in the Allowed Logout URLs set at the Auth0 Application level (see Setting Allowed Logout URLs at the App Level).</li>
<li>If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level).</li>
</ul>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>clientID</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>the Client ID found on your Application settings page</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>returnTo</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>URL to be redirected after the logout</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>federated</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>tells Auth0 if it should logout the user also from the IdP.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line214">line 214</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://auth0.com/docs/api/authentication#logout">https://auth0.com/docs/api/authentication#logout</a></li>
        </ul>
    </dd>
    

    
</dl>




















        
            

    

    
    <h4 class="name" id="delegation"><span class="type-signature"></span>delegation<span class="signature">(options, cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Makes a call to the <code>/delegation</code> endpoint with either an <code>id_token</code> or <code>refresh_token</code></p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>clientID</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>the Client ID found on your Application settings page</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>grantType</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>grant type used for delegation. The only valid value is <code>urn:ietf:params:oauth:grant-type:jwt-bearer</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>valid token of the user issued after Auth. If no <code>refresh_token</code> is provided this parameter is required</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>refreshToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>valid refresh token of the user issued after Auth. If no <code>id_token</code> is provided this parameter is required</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>target</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>the target ClientID of the delegation</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scope</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>either <code>openid</code> or <code>openid profile email</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>apiType</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>the api to be called</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">delegationCallback</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line594">line 594</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://auth0.com/docs/api/authentication#delegation">https://auth0.com/docs/api/authentication#delegation</a></li>
        
            <li><p>Requires <a href="https://auth0.com/docs/api-auth/grant/password#realm-support">http://auth0.com/oauth/grant-type/password-realm</a>. For more information, read <a href="https://auth0.com/docs/clients/client-grant-types">https://auth0.com/docs/clients/client-grant-types</a>.</p></li>
        </ul>
    </dd>
    

    
</dl>




















        
            

    

    
    <h4 class="name" id="getChallenge"><span class="type-signature"></span>getChallenge<span class="signature">(cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Makes a call to the <code>/usernamepassword/challenge</code> endpoint
and returns the challenge (captcha) if necessary.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">callback</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line564">line 564</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="getSSOData"><span class="type-signature"></span>getSSOData<span class="signature">(withActiveDirectories, cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Uses <code>checkSession</code> and localStorage to return data from the last successful authentication request.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>withActiveDirectories</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            

            

            <td class="description last"><p>this parameter is not used anymore. It's here to be backward compatible</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line467">line 467</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="login"><span class="type-signature"></span>login<span class="signature">(options, cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Makes a call to the <code>oauth/token</code> endpoint with <code>password-realm</code> grant type</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>username</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>email or username of the user that will perform Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>password</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>the password of the user that will perform Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scope</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>scopes to be requested during Auth. e.g. <code>openid email</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audience</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>identifier of the resource server who will consume the access token issued after Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>realm</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>the HRD domain or the connection name where the user belongs to. e.g. <code>Username-Password-Authentication</code></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">tokenCallback</span>


            
            </td>

            

            

            <td class="description last"><p>function called with the result of the request</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line324">line 324</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p>Requires <a href="https://auth0.com/docs/api-auth/grant/password#realm-support"><code>http://auth0.com/oauth/grant-type/password-realm</code> grant</a>. For more information, read <a href="https://auth0.com/docs/clients/client-grant-types">https://auth0.com/docs/clients/client-grant-types</a>.</p></li>
        </ul>
    </dd>
    

    
</dl>




















        
            

    

    
    <h4 class="name" id="loginWithDefaultDirectory"><span class="type-signature"></span>loginWithDefaultDirectory<span class="signature">(options, cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Makes a call to the <code>oauth/token</code> endpoint with <code>password</code> grant type to login to the default directory.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>username</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>email or username of the user that will perform Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>password</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>the password of the user that will perform Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scope</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>scopes to be requested during Auth. e.g. <code>openid email</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audience</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>identifier of the resource server who will consume the access token issued after Auth</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">tokenCallback</span>


            
            </td>

            

            

            <td class="description last"><p>function called with the result of the request</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line286">line 286</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p>Requires <a href="https://auth0.com/docs/api-auth/grant/password"><code>password</code> grant</a>. For more information, read <a href="https://auth0.com/docs/clients/client-grant-types">https://auth0.com/docs/clients/client-grant-types</a>.</p></li>
        </ul>
    </dd>
    

    
</dl>




















        
            

    

    
    <h4 class="name" id="loginWithResourceOwner"><span class="type-signature"></span>loginWithResourceOwner<span class="signature">(options, cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Performs authentication calling <code>/oauth/ro</code> endpoint with username
and password for a given connection name.</p>
<p>This method is not compatible with API Auth so if you need to fetch API tokens with audience
you should use <code>login</code> or <code>loginWithDefaultDirectory</code>.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>username</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>email or username of the user that will perform Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>password</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>the password of the user that will perform Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>connection</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>the connection name where the user belongs to. e.g. <code>Username-Password-Authentication</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scope</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>scopes to be requested during Auth. e.g. <code>openid email</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>device</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>name of the device/browser where the Auth was requested</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">tokenCallback</span>


            
            </td>

            

            

            <td class="description last"><p>function called with the result of the request</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line414">line 414</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="userInfo"><span class="type-signature"></span>userInfo<span class="signature">(accessToken, cb)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Makes a call to the <code>/userinfo</code> endpoint and returns the user profile</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>accessToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>token issued to a user after Auth</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">userInfoCallback</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line538">line 538</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://auth0.com/docs/api/authentication#get-user-info">https://auth0.com/docs/api/authentication#get-user-info</a></li>
        </ul>
    </dd>
    

    
</dl>




















        
    

    
        <h3 class="subsection-title">Type Definitions</h3>

        
                

    

    
    <h4 class="name" id="authorizeCallback"><span class="type-signature"></span>authorizeCallback<span class="signature">(err<span class="signature-attributes">opt</span>, result<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>err</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>error returned by Auth0 with the reason of the Auth failure</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>result</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>result of the Auth request. If there is no token available, this value will be null.</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>accessToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>token that allows access to the specified resource server (identified by the audience parameter or by default Auth0's /userinfo endpoint)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>expiresIn</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>number of seconds until the access token expires</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>token that identifies the user</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>refreshToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>token that can be used to get new access tokens from Auth0. Note that not all Auth0 Applications can request them or the resource server might not allow them.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>appState</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>values that you receive back on the authentication response</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line263">line 263</a>
    </li></ul></dd>
    

    

    

    
</dl>




















            
                

    

    
    <h4 class="name" id="delegationCallback"><span class="type-signature"></span>delegationCallback<span class="signature">(err<span class="signature-attributes">opt</span>, result<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>err</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>error returned by Auth0 with the reason why the delegation failed</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>result</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>result of the delegation request. The payload depends on what ai type was used</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line587">line 587</a>
    </li></ul></dd>
    

    

    

    
</dl>




















            
                

    

    
    <h4 class="name" id="tokenCallback"><span class="type-signature"></span>tokenCallback<span class="signature">(err<span class="signature-attributes">opt</span>, result<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>err</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>error returned by Auth0 with the reason of the Auth failure</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>result</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>result of the Auth request</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>accessToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>token that allows access to the specified resource server (identified by the audience parameter or by default Auth0's /userinfo endpoint)</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>expiresIn</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>number of seconds until the access token expires</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>token that identifies the user</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>refreshToken</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>token that can be used to get new access tokens from Auth0. Note that not all Auth0 Applications can request them or the resource server might not allow them.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line275">line 275</a>
    </li></ul></dd>
    

    

    

    
</dl>




















            
                

    

    
    <h4 class="name" id="userInfoCallback"><span class="type-signature"></span>userInfoCallback<span class="signature">(err<span class="signature-attributes">opt</span>, userInfo<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>err</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>error returned by Auth0</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>userInfo</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>user information</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="authentication_index.js.html">authentication/index.js</a>, <a href="authentication_index.js.html#line531">line 531</a>
    </li></ul></dd>
    

    

    

    
</dl>




















            
    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Authentication.html">Authentication</a></li><li><a href="Management.html">Management</a></li><li><a href="Popup.html">Popup</a></li><li><a href="Redirect.html">Redirect</a></li><li><a href="WebAuth.html">WebAuth</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Oct 06 2025 14:15:35 GMT+0530 (India Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>